﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// 可以显示设定文字的按钮
/// </summary>
public class TextButton : MonoBehaviour
{
    public Text text;
    public Button button;
    
    public void Init(string str,UnityEngine.Events.UnityAction callBack)
    {
        text.text = str;
        button.onClick.RemoveAllListeners();
        button.onClick.AddListener(()=> {
            SoundManager.Instance.PlayAudio(SoundType.Click.ToString(), false);
            callBack();
        });
    }

    
}
